package org.theqcp.wow.sim.engine.revised.scripts;

import org.theqcp.wow.sim.engine.revised.enums.SpellType;

public class SpellFactory extends ScriptedEventObserverFactory<Spell> {

    private static SpellFactory spellFactory = null;

    public static Spell newObserver( SpellType type ) throws ClassNotFoundException {
	if( spellFactory == null ) {
	    spellFactory = new SpellFactory();
	}
	return spellFactory.newEventObserver(type);
    }

    public static Spell newObserver( String type ) throws ClassNotFoundException {
	if( spellFactory == null ) {
	    spellFactory = new SpellFactory();
	}
	return spellFactory.newEventObserver(type);
    }

    private final String basePath = "res/spells/";

    public Spell newEventObserver( SpellType type ) throws ClassNotFoundException {
	return (Spell) super.newEventObserver(type, basePath);
    }

    public Spell newEventObserver( String type ) throws ClassNotFoundException {
	return (Spell) super.newEventObserver(type, basePath);
    }

}
